<?php
  $classes = array(
    'type-image',
    'normal column',
    'is'
  );
?>

<?php get_header(); ?>
	<?php if (have_posts()) : ?>
	
		<div class="post_content">
			<div class="is-content container index content">
					<?php
					while (have_posts()) : the_post(); ?>
						<div id="post-<?php the_ID(); ?>" <?php post_class($classes); ?>>
                                                <div class="media">
                                                    <a href="<?php the_permalink(); ?>">
                                                        <?php 
                                                        if ( has_post_thumbnail() ) {
                                                            if(in_category("xl")){
                                                                the_post_thumbnail('laplazita_large');
								the_post_thumbnail('laplazita_large-gray');
                                                            }else {
                                                                the_post_thumbnail('laplazita_small');
								the_post_thumbnail('laplazita_small-gray');
                                                            }
                                                        }
                                                        else {
                                                            if(in_category("xl")){
                                                                echo '<img src="' . get_template_directory_uri() . '/images/default-large.jpg" />';
                                                            }else {
                                                                echo '<img src="' . get_template_directory_uri() . '/images/default-small.jpg" />';
                                                            } 
                                                        }
                                                        ?>
                                                        
                                                    </a>
                                                    <!--div class="info">
                                                        <div class="date"><?php the_time('j M -y'); ?></div>
                                                    </div-->
                                                    <!--div class="watermark"></div-->
                                                </div>
                                            </div>
				   <?php endwhile; 
					?>
			</div>
		</div>
		<?php
		$use_infinite_scroll= get_option('redox_use_infinite_scroll');
		if ($use_infinite_scroll == "true") {
		?>
		<div class="container">
    		<div class="full column">
    			<div id="is-more" class="pagination-selector clearfix">
    				<?php 
						if( get_next_posts_link() != '') {
					?>
					<div class="next">
						<?php
							next_posts_link('Cargar anteriores'); 
						?>		
					</div>
					<?php
						}
					?>
		    	</div>
			</div>	
    	</div>
		<?php
		}
		if ($use_infinite_scroll == "false") {
		?>
    			<div id="pagination-wrap">
	    			<div id="pagination">
						<div class="page left">
							<?php 
							if( get_previous_posts_link() != '') {
								previous_posts_link('<i class="icon-left-dir"></i>'); 
							} 
							else {
							?>
								<i class="icon-left-dir">
								</i>
							<?php
							}
							?>	
						</div>
						<div class="page count">Page
							<?php 
							$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; 
							echo $paged.' of '.$wp_query->max_num_pages; 
							?>
						</div>
						<div class="page right">
							<?php 
							if( get_next_posts_link() != '') {
							next_posts_link('<i class="icon-right-dir"></i>'); 
							} 
							else {
							?>
							<i class="icon-right-dir">
							</i>
							<?php
							}
							?>	
						</div>
					</div>
    	</div>
		<?php
		}
		?>
		<?php else :?>
		<div class="post_content">
			<div class="container content">
				<div class="eight post columns type-text content-else">
					<h3 class="title">
						Not Found
					</h3>
					<div class="entry body">
						<p>
							Sorry. No posts could be found.
						</p>	
					</div>
				</div>
			</div>
		</div>
	<?php endif; ?>
<?php get_footer(); ?>